/*
 * ShaderTypes.h
 *
 *  Created on: 25.09.2011
 *      Author: Blinov Kirill
 *      Copyright: LGPL
 */

#ifndef SHADERTYPES_H_
#define SHADERTYPES_H_

#include "BasicTypes.h"

class CShaderProgramm
{
private:
	void FillParamReferences( const SHADER_TYPES Type );
public: //FIXME protected
	GLuint             programmName;
	GLint 			   paramReferences[SHADER_INPUT_MAX];
public:
	CShaderProgramm(): programmName(0){};
	CShaderProgramm( const GLuint ShaderName, const SHADER_TYPES Type );
	virtual ~CShaderProgramm();
	bool InitShader( const GLuint ProgrammName, const SHADER_TYPES Type );
	void SetParam( const SHADER_INPUT_PARAMS ParamName, const int Value );
	void SetParam( const SHADER_INPUT_PARAMS ParamName, const float Value );
	void SetParam( const SHADER_INPUT_PARAMS ParamName, const glm::vec3& Value );
	void SetParam( const SHADER_INPUT_PARAMS ParamName, const glm::vec4& Value );
	void SetParam( const SHADER_INPUT_PARAMS ParamName, const glm::mat4& Value );
	void SetParam( const SHADER_INPUT_PARAMS ParamName, const std::vector<glm::mat4>& Value );
	void ActivateShader( const bool Activate ){ glUseProgram( Activate ? programmName : 0 ); }; //Control shader usage
};

#endif /* SHADERTYPES_H_ */
